package demo7;

/**
 * @author Huangjin
 * @version 1.0
 * describe:
 * @date 2023/2/28 18:10
 */
public class SubstringDemo {
    public static void main(String[] args) {
        String str = "www.tedu.cn";
        int start = str.indexOf(".")+1;
        int end = str.indexOf(".",start);
        String name = str.substring(start,end);
        System.out.println(name);
        //////////////////////////
        String str1 = "www.tedu.cn";
        int start1 = str1.indexOf(".")+1;
        int end1 = str1.indexOf(".",start1);
        String name1 = str1.substring(start1,end1);
        System.out.println(name1);
    }
}
